<?php
/*
User Email System
Version 1.0
by:vbgamer45
http://www.smfhacks.com
*/
function template_main()
{
	global $db_prefix, $scripturl, $txt, $user_info,$settings, $modSettings,$context;
	echo '<div class="tborder" >';
	echo '
<form method="POST" action="' . $scripturl . '?action=useremail&sa=save">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" height="129">
  <tr>
    <td width="50%" colspan="2" height="19" align="center" class="catbg">
    <b>Send an e-mail message</b></td>
  </tr>
  <tr>
    <td width="28%" height="19" class="windowbg2"><span class="gen"><b>Recipient</b></span></td>
    <td width="72%" height="19" class="windowbg2">' . $context['user_email_name'] . '<input type="hidden" name="userid" value="' . $context['user_email_id'] . '" /></td>
  </tr>
  <tr>
    <td width="28%" height="22" class="windowbg2"><span class="gen"><b>Subject</b></span></td>
    <td width="72%" height="22" class="windowbg2"><input type="text" name="subject" size="64" /></td>
  </tr>
  <tr>
    <td width="28%" height="19" valign="top" class="windowbg2"><span class="gen"><b>Message body</b></span></td>
    <td width="72%" height="19" class="windowbg2"><textarea rows="6" name="message" cols="54"></textarea></td>
  </tr>
  <tr>
    <td width="28%" height="19" class="windowbg2"><span class="gen"><b>Options</b></span></td>
    <td width="72%" height="19" class="windowbg2">
    <input type="checkbox" name="sendcopy" value="ON" checked /><b><span class="gen">Send
    a copy of this e-mail to yourself</span></b></td>
  </tr>
  <tr>
    <td width="28%" colspan="2" height="26" align="center" class="windowbg2">
    <input type="submit" value="Send e-mail" name="submit" /></td>

  </tr>
</table>
</form>';
	echo '</div>';

	//Copryright keep it please. Helps support the mod making for SMF
	echo '<br /><div align="center"><a href="http://www.smfhacks.com" target="blank">User Email System</a></div>
	</div>';
}
function template_send()
{
	global $boardurl;
echo '
<div>
	<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
		<tr class="titlebg">
			<td>Your email has been sent!</td>
		</tr>

		<tr class="windowbg">
			<td style="padding: 3ex;">
				Your email has been sent! Click <a href="' . $boardurl . '">here</a> to return to the board.
			</td>
		</tr>
	</table>
</div>';
}
?>